<?php
class Default_Model_right extends Zend_Db_Table
{
	public function get_section_product()
	{ 
	    $ns = new Zend_Session_Namespace('lang');
	    $lang=$ns->lang;
		$db = Zend_Registry::get('connectDb');
		$select = $db->select()
		          ->from('section_product', array('id','title')) 
		          ->where('published = ?', '1')
		          ->where('language_id = ?',$lang);		          
		$result = $db->fetchAll($select);
	    return $result;          
		
	}	
	
	public function get_category_product($id)
	{ 
	    $ns = new Zend_Session_Namespace('lang');
	    $lang=$ns->lang;
		$db = Zend_Registry::get('connectDb');
		$select = $db->select()
		          ->from('category_product', array('id','title')) 
		          ->where('published = ?', '1')
		          ->where('language_id = ?',$lang)
		          ->where('section_product_id = ?',$id);		          
		$result = $db->fetchAll($select);
	    return $result;          
		
	}		
	
	public function get_details_product($id)
	{
	    $ns = new Zend_Session_Namespace('lang');
	    $lang=$ns->lang;
		$db = Zend_Registry::get('connectDb');
		$select = $db->select()
		          ->from('details_product', array('id','title')) 
		          ->where('published = ?', '1')
		          ->where('language_id = ?',$lang)
		          ->where('category_product_id = ?',$id);		         
		$result = $db->fetchAll($select);
	    return $result;          
		
	}	
	
	public function get_child($id)
	{
	    $ns = new Zend_Session_Namespace('lang');
	    $lang=$ns->lang;
		$db = Zend_Registry::get('connectDb');
		$select = $db->select()
		          ->from('menu', array('id','title','type','keyt_id')) 
		          ->where('published = ?', '1')
		          ->where('language_id = ?',$lang)
		          ->where('parents 	 = ?',$id);
		$result = $db->fetchAll($select);
	    return $result;          
		
	}	
}